<template>
  <div class="Declare">
    <!-- 申请资料 -->
    <div class="title2">
      <div v-if="type == 0">【示范平台申报详情】</div>
      <div v-if="type == 1">【示范基地申报详情】</div>
      <div v-if="type == 2">【入驻机构申报详情】</div>
      <div v-if="zhuangtai == 0" style="color: #1CA9FF;">当前申报状态:待审核</div>
      <div v-if="zhuangtai == 1" style="color: green;">当前申报状态:已通过</div>
      <div v-if="zhuangtai == 2" style="color: red;">当前申报状态:已驳回</div>
      <div v-if="zhuangtai == 3" style="color: #ef9f0b;">当前申报状态:审核中</div>
      <div v-if="zhuangtai == 4" style="color: #A5A9AF;">当前申报状态:草稿</div>
      <div v-if="level == 0">申报级别:国家级</div>
      <div v-if="level == 1">申报级别:省级</div>
      <div v-if="level == 2">申报级别:市级</div>
    </div>
    <div class="ruzhuForm" v-if="type == '2'">
      <el-form ref="rongziRules" label-position="top" :model="table"
        :disabled="zhuangtai == 0 || zhuangtai == 1 || zhuangtai == 3" :rules="rongziRules">
        <el-row>
          <el-col :span="12" class="form-item">
            <el-form-item label="注册时间（存续两年）" prop="registerLogin">
              <el-date-picker v-model="table.registerLogin" type="date" placeholder="选择日期" @focus="inputFocus"
                value-format="yyyy-MM-dd hh:mm:ss">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12" class="form-item">
            <el-form-item label="固定场所" prop="fixedPlace">
              <el-input v-model="table.fixedPlace" placeholder="请输入固定场所"></el-input>
            </el-form-item>
          </el-col>

        </el-row>
        <el-row>
          <el-col :span="12" class="form-item">
            <el-form-item label="人员配置情况" prop="staffingSituation">
              <el-input v-model="table.staffingSituation" placeholder="请输入人员配置情况"></el-input>
            </el-form-item>
          </el-col>

        </el-row>
        <el-row>
          <el-col :span="12" class="form-item">
            <el-form-item label="专业团队" prop="professionalTeam">
              <el-input type="textarea" :rows="3" placeholder="请输入专业团队" v-model="table.professionalTeam">
              </el-input>
            </el-form-item>
          </el-col>

        </el-row>
        <el-row>
          <el-col :span="12" class="form-item">
            <el-form-item label="服务客户数量及符合重点支持方向" prop="serveClientsDirection">
              <el-input type="textarea" :rows="3" placeholder="请输入服务客户数量及符合重点支持方向" v-model="table.serveClientsDirection">
              </el-input>
            </el-form-item>
          </el-col>

        </el-row>
      </el-form>
    </div>
    <div class="tableBox">
      <el-table
        :data="(type == '0' && huixian.slice(0, 7)) || (type == '1' && huixian.slice(0, 10)) || (type == '2' && huixian)"
        class="my-table" border style="width: 100%;" :disabled="true">
        <el-table-column width="60px" align="center" label="序号" type="index" :label-class-name="'table-header'">
        </el-table-column>
        <el-table-column width="100px" align="center" label="是否必填" :label-class-name="'table-header'">
          <template slot-scope="scope">
            <span
              v-if="(type == '0') || (type == '1' && scope.$index !== 9) || ((type == '2' && scope.$index !== 3) && (type == '2' && scope.$index !== 4) && (type == '2' && scope.$index !== 5))">是</span>
            <span v-else>否</span>
          </template>
        </el-table-column>
        <el-table-column width="300px" label="资料名称" prop="name" :label-class-name="'table-header'">
          <template slot-scope="scope">
            <span class="name">

              {{ scope.row.dataName | flitt() }}</span>
          </template>
        </el-table-column>
        <el-table-column align="center" label="资料上传" :label-class-name="'table-header'">
          <template slot-scope="{row}">
            <el-upload class="upload-demo" :action="https + 'zxqyfw/pub/fileUploadRecord/upload'" :on-preview="handlePreview"
              :data="uploadfile(row.name, '资料上传')" :headers="{ Authorization: token }" :before-upload="beforelod"
              :disabled="zhuangtai == '1' || zhuangtai == '3' || zhuangtai == '0' || (zhuangtai == '2' && row.pprovalStatus == '1') || (zhuangtai == '4' && row.pprovalStatus == '1')"
              :on-success="(response, file, fileList) => { return handleSuccess(response, file, fileList, row, row.name, '资料上传') }"
              :on-remove="(file, fileList) => handleRemove(file, fileList, row, 1)" :before-remove="beforeRemove" multiple
              :limit="3" :on-exceed="handleExceed" :accept="'.pdf'" :file-list="row.fileNameList">
              <el-icon
                v-if="(zhuangtai == '2' && row.pprovalStatus == '2') || (zhuangtai == '2' && row.pprovalStatus == '0') || (zhuangtai == '4' && row.pprovalStatus == '2') || (zhuangtai == '4' || row.pprovalStatus == '0')"
                class="iconDownload1" name="upload2"></el-icon>
              <span
                v-if="(zhuangtai == '2' && row.pprovalStatus == '2') || (zhuangtai == '2' && row.pprovalStatus == '0') || (zhuangtai == '4' && row.pprovalStatus == '2') || (zhuangtai == '4' || row.pprovalStatus == '0')"
                class="text1">上传文件</span>
            </el-upload>
            <div v-if="zhuangtai == 0 || zhuangtai == 1 || zhuangtai == 3">
              <!-- <p v-for="(item, index) in row.fileNameList" :key="index" style="cursor: pointer;"
                @click="handlePreview(item)">{{ item.fileName }}</p> -->
            </div>
          </template>
        </el-table-column>
        <el-table-column align="center" label="辅助证明文件上传" :label-class-name="'table-header'">
          <template slot-scope="{row}">
            <el-upload class="upload-demo" :action="https + 'zxqyfw/pub/fileUploadRecord/upload'" :on-preview="handlePreview"
              :data="uploadfile(row.name, '辅助证明文件上传')" :headers="{ Authorization: token }" :before-upload="beforelod"
              :disabled="zhuangtai == '1' || zhuangtai == '3' || zhuangtai == '0' || (zhuangtai == '2' && row.pprovalStatus == '1')"
              :on-success="(response, file, fileList) => { return handleSuccess(response, file, fileList, row, row.name, '辅助证明文件上传') }"
              :on-remove="(file, fileList) => handleRemove(file, fileList, row, 2)" :before-remove="beforeRemove" multiple
              :limit="3" :on-exceed="handleExceed" :accept="'.pdf'" :file-list="row.axioyNameList">
              <el-icon
                v-if="(zhuangtai == '2' && row.pprovalStatus == '2') || (zhuangtai == '2' && row.pprovalStatus == '0') || (zhuangtai == '4' && row.pprovalStatus == '2') || (zhuangtai == '4' || row.pprovalStatus == '0')"
                class="iconDownload1" name="upload2"></el-icon>
              <span
                v-if="(zhuangtai == '2' && row.pprovalStatus == '2') || (zhuangtai == '2' && row.pprovalStatus == '0') || (zhuangtai == '4' && row.pprovalStatus == '2') || (zhuangtai == '4' || row.pprovalStatus == '0')"
                class="text1">上传文件</span>
            </el-upload>
            <!-- <div v-if="zhuangtai == 0 || zhuangtai == 1 || zhuangtai == 3">
              <p v-for="(item, index) in row.axioyNameList" :key="index" style="cursor: pointer;"
                @click="handlePreview(item)">{{ item.fileName }}</p>
            </div> -->
          </template>
        </el-table-column>
        <el-table-column width="150" align="center" label="审核状态" prop="status" :label-class-name="'table-header'">
          <template slot-scope="scope">
            <span class="status">{{ scope.row.pprovalStatus === 0 ? '待审核' : scope.row.pprovalStatus === 1 ? '已通过' :
              scope.row.pprovalStatus === 2 ? '已驳回' : '' }}</span>
            <p class="yijian" v-if="zhuangtai == 1 || zhuangtai == 2" @click="open('审批意见', scope.row.approvalOpinion)">
              审批意见</p>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!-- 相关资料 -->
    <div class="title2" v-if="type != '1' && type != '2'">
      【相关资料】
    </div>
    <div class="tableBox" v-if="type != '1' && type != '2'">
      <el-table :data="type == '0' && huixian.slice(7, 13)" class="my-table" border style="width: 100%;">
        <el-table-column width="60px" align="center" label="序号" type="index" :label-class-name="'table-header'">
        </el-table-column>
        <el-table-column width="100px" align="center" label="是否必填" :label-class-name="'table-header'">
          <template slot-scope="scope">
            <span 
              v-if="(type == '0' && scope.$index !== 2) && (type == '0' && scope.$index !== 3) && (type == '0' && scope.$index !== 5)">是</span>
            <span v-else>否</span>
          </template>
        </el-table-column>
        <el-table-column width="300px" label="资料名称" prop="name" :label-class-name="'table-header'">
          <template slot-scope="scope">

            <span class="name">{{ scope.row.dataName | flitt() }}</span>
          </template>
        </el-table-column>

        <el-table-column align="center" label="资料上传" :label-class-name="'table-header'">
          <template slot-scope="{row}">
            <el-upload class="upload-demo" :action="https + 'zxqyfw/pub/fileUploadRecord/upload'" :on-preview="handlePreview"
              :data="uploadfile(row.name, '资料上传')" :headers="{ Authorization: token }" :before-upload="beforelod"
              :disabled="zhuangtai == '1' || zhuangtai == '3' || zhuangtai == '0' || (zhuangtai == '2' && row.pprovalStatus == '1')"
              :on-success="(response, file, fileList) => { return handleSuccess(response, file, fileList, row, row.name, '资料上传') }"
              :on-remove="(file, fileList) => handleRemove(file, fileList, row, 1)" :before-remove="beforeRemove" multiple
              :limit="3" :on-exceed="handleExceed" :accept="'.pdf'" :file-list="row.fileNameList">
              <el-icon
                v-if="(zhuangtai == '2' && row.pprovalStatus == '2') || (zhuangtai == '2' && row.pprovalStatus == '0') || (zhuangtai == '4' && row.pprovalStatus == '2') || (zhuangtai == '4' || row.pprovalStatus == '0')"
                class="iconDownload1" name="upload2"></el-icon>
              <span
                v-if="(zhuangtai == '2' && row.pprovalStatus == '2') || (zhuangtai == '2' && row.pprovalStatus == '0') || (zhuangtai == '4' && row.pprovalStatus == '2') || (zhuangtai == '4' || row.pprovalStatus == '0')"
                class="text1">上传文件</span>
            </el-upload>
            <div v-if="zhuangtai == 0 || zhuangtai == 1 || zhuangtai == 3">
              <!-- <p v-for="(item, index) in row.fileNameList" :key="index" style="cursor: pointer;"
                @click="handlePreview(item)">{{ item.fileName }}</p> -->
            </div>
          </template>
        </el-table-column>
        <el-table-column align="center" label="辅助证明文件上传" :label-class-name="'table-header'">
          <template slot-scope="{row}">
            <el-upload class="upload-demo" :action="https + 'zxqyfw/pub/fileUploadRecord/upload'" :on-preview="handlePreview"
              :data="uploadfile(row.name, '辅助证明文件上传')" :headers="{ Authorization: token }" :before-upload="beforelod"
              :disabled="zhuangtai == '1' || zhuangtai == '3' || zhuangtai == '0' || (zhuangtai == '2' && row.pprovalStatus == '1')"
              :on-success="(response, file, fileList) => { return handleSuccess(response, file, fileList, row, row.name, '辅助证明文件上传') }"
              :on-remove="(file, fileList) => handleRemove(file, fileList, row, 2)" :before-remove="beforeRemove" multiple
              :limit="3" :on-exceed="handleExceed" :accept="'.pdf'" :file-list="row.axioyNameList">
              <el-icon
                v-if="(zhuangtai == '2' && row.pprovalStatus == '2') || (zhuangtai == '2' && row.pprovalStatus == '0') || (zhuangtai == '4' && row.pprovalStatus == '2') || (zhuangtai == '4' || row.pprovalStatus == '0')"
                class="iconDownload1" name="upload2"></el-icon>
              <span
                v-if="(zhuangtai == '2' && row.pprovalStatus == '2') || (zhuangtai == '2' && row.pprovalStatus == '0') || (zhuangtai == '4' && row.pprovalStatus == '2') || (zhuangtai == '4' || row.pprovalStatus == '0')"
                class="text1">上传文件</span>
            </el-upload>
            <div v-if="zhuangtai == 0 || zhuangtai == 1 || zhuangtai == 3">
              <!-- <p v-for="(item, index) in row.axioyNameList" :key="index" style="cursor: pointer;"
                @click="handlePreview(item)">{{ item.fileName }}</p> -->
            </div>
          </template>
        </el-table-column>
        <el-table-column width="150" align="center" label="审核状态" prop="status" :label-class-name="'table-header'">
          <template slot-scope="scope">
            <span class="status">{{ scope.row.pprovalStatus === 0 ? '待审核' : scope.row.pprovalStatus === 1 ? '已通过' :
              scope.row.pprovalStatus === 2 ? '已驳回' : '' }}</span>
            <p class="yijian" v-if="zhuangtai == 1 || zhuangtai == 2" @click="open('审批意见', scope.row.approvalOpinion)">
              审批意见</p>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="tableFoot">
      <button v-if="zhuangtai == 2" @click="submit(4)">保存</button>
      <button v-if="zhuangtai == 4" @click="submit(4)">保存</button>
      <button v-if="zhuangtai == 2" @click="submit(0)">提交</button>
      <button v-if="zhuangtai == 4" @click="submit(0)">提交</button>
      <!-- <button v-if="isshenbao==0" @click="quxiao">撤销申报</button> -->
    </div>
  </div>
</template>

<script>
import { shifan_reset, download, moban_list, upload_file, shifan_detail, getFileName, repeal, pingtai_Count, jidi_reset, jigou_reset, zhubiao_detail } from '../../api/api'
import { http } from '@/until/http';
export default {
  props: {
    propA: Object,
    /*是否显示上传文件按钮、是否显示文件删除×号*/
    showUploadBtn: {
      type: Boolean,
      default: true,
    },
  },
  data() {
    return {
      https: http,
      status: this.propA,
      //是否已申报
      isshenbao: '',
      uploadData: {

      },
      fileList: [],
      response: '',
      tableData: [],
      tableData2: [],
      token: '',
      upload: {
        "userId": this.$store.state.userId,
        "file1": { "1,兰州市中小企业公共服务示范平台申请推荐表_资料上传": [] },
        "file2": { "1,兰州市中小企业公共服务示范平台申请推荐表_辅助证明文件上传": [] },
        "file3": { "2,兰州市中小企业公共服务示范平台主要从业人员情况表_资料上传": [] },
        "file4": { "2,兰州市中小企业公共服务示范平台主要从业人员情况表_辅助证明文件上传": [] },
        "file5": { "3,兰州市中小企业公共服务示范平台服务设施设备清单_资料上传": [] },
        "file6": { "3,兰州市中小企业公共服务示范平台服务设施设备清单_辅助证明文件上传": [] },
        "file7": { "4,申请报告提纲_资料上传": [] },
        "file8": { "4,申请报告提纲_辅助证明文件上传": [] },
        "file9": { "5,服务中小企业名单及满意度评价表_资料上传": [] },
        "file10": { "5,服务中小企业名单及满意度评价表_辅助证明文件上传": [] },
        "file11": { "6,示范平台申报单位须确保申报材料的真实性和完整性填报申报材料真实性声明_资料上传": [] },
        "file12": { "6,示范平台申报单位须确保申报材料的真实性和完整性填报申报材料真实性声明_辅助证明文件上传": [] },
        "file13": { "7,法人证书或营业执照副本(复印件)_资料上传": [] },
        "file14": { "7,法人证书或营业执照副本(复印件)_辅助证明文件上传": [] },
        "file15": { "8,上一年度审计报告及服务收支情况的专项审计报告_资料上传": [] },
        "file16": { "8,上一年度审计报告及服务收支情况的专项审计报告_辅助证明文件上传": [] },
        "file17": { "9,开展相关服务的佐证材料(通知、照片、总结等)_资料上传": [] },
        "file18": { "9,开展相关服务的佐证材料(通知、照片、总结等)_辅助证明文件上传": [] },
        "file19": { "10,国家和省市颁发的从业资格(资质)、许可证等佐证材料(复印件)，与服务能力相关的专利、商标、品牌、标准、软件著作权等佐证材料(复印件)_资料上传": [] },
        "file20": { "10,国家和省市颁发的从业资格(资质)、许可证等佐证材料(复印件)，与服务能力相关的专利、商标、品牌、标准、软件著作权等佐证材料(复印件)_辅助证明文件上传": [] },
        "file21": { "11,市(州)及以上政府主管部门授予的荣誉证书(证明)复印件、获得各级政府的扶持情况_资料上传": [] },
        "file22": { "11,市(州)及以上政府主管部门授予的荣誉证书(证明)复印件、获得各级政府的扶持情况_辅助证明文件上传": [] },
        "file23": { "12,其他佐证材料_资料上传": [] },
        "file24": { "12,其他佐证材料_辅助证明文件上传": [] },
        "dataType": 0,
        "applicationId": 1,
        "applicationType": 0,
      },
      //回显数组
      huixian: [],
      chexiao: [],
      level: null,
      type: null,
      zhuangtai: null,
      reviewId: null,
      table: {
        "userId": this.$store.state.userId,
        "level": 3,
        "applicationType": 2,
        "fixedPlace": "",
        "professionalTeam": "",
        "registerLogin": "",
        "serveClientsDirection": "",
        "staffingSituation": "",
        "dataType": 0,

      },
      rongziRules: {
        registerLogin: [
          { required: true, message: '请输入注册时间', trigger: 'blur' },
        ],
        fixedPlace: [
          { required: true, message: '请输入固定场所', trigger: 'blur' },
        ],
        staffingSituation: [
          { required: true, message: '请输入人员配置情况', trigger: 'blur' },
        ],
        professionalTeam: [
          { required: true, message: '请输入专业团队人员', trigger: 'blur' },
        ],
        serveClientsDirection: [
          { required: true, message: '请输入服务客户数量及符合重点支持方向', trigger: 'blur' },
        ],
      },
    };
  },
  methods: {
    inputFocus(){
this.table.registerLogin=''
    }
,
    handleCommand(command) {
      this.huixian[0].applicationLevel = command
    },
    //取消申报
    quxiao() {
      this.chexiao = this.chexiao.join(',')
      repeal({ id: this.chexiao }).then((res) => {
        if (res.data.state == '20000') {
          this.$message({
            message: '撤销成功',
            type: 'success'
          });
        } else {
          this.$message.error(res.data.message);
        }

      })
    },
    uploadfile(rowname, type) {
      return { userId: this.$store.state.userId, name: rowname, type: type }
    },
    zancun() {
      console.log(this.fileList);
    },

    open(title, yijian) {
      this.$alert(yijian, title, {
        confirmButtonText: '确定'
      });
      // console.log(yijian);
    },
    submit(state) {
      const data = this.huixian.reduce((prev, next, index) => {
        const startIndex = index * 2;
        const dataName = (next.id + ',') + next.dataName.split(',').pop();
        prev[`file${startIndex + 1}`] = {
          [dataName + '_资料上传']: next?.fileNameList?.map(item => item.fileId) || [],
        }
        prev[`file${startIndex + 2}`] = {
          [dataName + '_辅助证明文件上传']: next?.axioyNameList?.map(item => item.fileId) || [],
        }
        return prev;
      }, {})
      console.log(data);
      data.userId = this.$store.state.userId;
      data.dataType = this.huixian[0].dataType;
      data.applicationId = this.huixian[0].applicationId;
      data.applicationType = this.type
      data.pprovalStatus = state
      data.level = this.level
     
      if (state == '4') {
        if (this.type == '0') {
          shifan_reset(data).then((res) => {
            if (res.data.state == '20000') {
              this.$message({
                message: '保存成功',
                type: 'success',
              });
              location.reload()
            }
            ;
          })
        } else if (this.type == '1') {
          // console.log(this.type);
          jidi_reset(data).then((res) => {
            if (res.data.state == '20000') {
              this.$message({
                message: '保存成功',
                type: 'success',
              });
              location.reload()
            }
            ;
          })
        } else if (this.type == '2') {
        if(this.table.registerLogin){
          data.registerLogin = this.table.registerLogin.replace('T', ' ')
        }
          data.fixedPlace = this.table.fixedPlace
          data.professionalTeam = this.table.professionalTeam
          data.serveClientsDirection = this.table.serveClientsDirection
          data.staffingSituation = this.table.staffingSituation
          jigou_reset(data).then((res) => {
            console.log(res);
            if (res.data.state == '20000') {
              this.$message({
                message: '保存成功',
                type: 'success',
              });
              location.reload()
            }
            ;
          })
        }
      } else if (state == '0') {
        if (this.type == '0') {
          let onelist = this.huixian.slice(0, 7)
          let twolist = this.huixian.slice(6)
          let rj1 = onelist[0].fileNameList
          let rj2 = onelist[1].fileNameList
          let rj3 = onelist[2].fileNameList
          let rj4 = onelist[3].fileNameList
          let rj5 = onelist[4].fileNameList
          let rj6 = onelist[5].fileNameList
          let rj7 = onelist[6].fileNameList
          let qj1 = twolist[0].fileNameList
          let qj2 = twolist[1].fileNameList
          let qj3 = twolist[2].fileNameList
          let qj4 = twolist[3].fileNameList
          let qj5 = twolist[4].fileNameList
          let qj6 = twolist[5].fileNameList

          console.log(qj2.length);
          console.log(qj3.length);
          // console.log(rj7.length);

          if (rj1.length <= 0 || rj2.length <= 0 || rj3.length <= 0 || rj4.length <= 0 || rj5.length <= 0 || rj6.length <= 0 || rj7.length <= 0
            || qj2.length <= 0 || qj3.length <= 0 || qj6.length <= 0) {
            this.$message.error('您有必填项未上传')
          }
          else {
            shifan_reset(data).then((res) => {
              if (res.data.state == '20000') {
                this.$message({
                  message: '提交成功',
                  type: 'success',
                });
                location.reload()
              }
              ;
            })
          }

        } else if (this.type == '1') {
          let onelist = this.huixian
          let rj1 = onelist[0].fileNameList
          let rj2 = onelist[1].fileNameList
          let rj3 = onelist[2].fileNameList
          let rj4 = onelist[3].fileNameList
          let rj5 = onelist[4].fileNameList
          let rj6 = onelist[5].fileNameList
          let rj7 = onelist[6].fileNameList
          let rj8 = onelist[7].fileNameList
          let rj9 = onelist[8].fileNameList
          let rj10 = onelist[9].fileNameList
          if (rj1.length <= 0 || rj1.length <= 0 || rj2.length <= 0 || rj3.length <= 0 || rj4.length <= 0 || rj5.length <= 0 || rj6.length <= 0 || rj7.length <= 0
            || rj8.length <= 0 || rj9.length <= 0) {
            this.$message.error('您有必填项未上传')
          } else {
            // console.log(this.type);
            jidi_reset(data).then((res) => {
              if (res.data.state == '20000') {
                this.$message({
                  message: '提交成功',
                  type: 'success',
                });
                location.reload()
              }
              ;
            })
          }

        } else if (this.type == '2') {
          data.fixedPlace = this.table.fixedPlace
          data.professionalTeam = this.table.professionalTeam
          if(this.table.registerLogin){
          data.registerLogin = this.table.registerLogin.replace('T', ' ')
        }
          data.serveClientsDirection = this.table.serveClientsDirection
          data.staffingSituation = this.table.staffingSituation
          let onelist = this.huixian
          console.log(onelist);
          let rj1 = onelist[0].fileNameList
          let rj2 = onelist[1].fileNameList
          let rj3 = onelist[2].fileNameList
          // let rj4 = onelist[3].fileNameList
          // let rj5 = onelist[4].fileNameList
          // let rj6 = onelist[5].fileNameList
          if (rj1.length <= 0 || rj2.length <= 0 || rj3.length <= 0) {
            this.$message.error('您有必填项未上传')
          } else {
            this.$refs.rongziRules.validate(valid => {
              if(valid){
                jigou_reset(data).then((res) => {
              if (res.data.state == '20000') {
                this.$message({
                  message: '提交成功',
                  type: 'success',
                });
                location.reload()
              }
            })
              }else{
                this.$message.error('您有必填项未上传')
              }
            })
            
          }
        }
      }
    },
    download(row) {
      console.log(row);
      download({ fileId: '1657779828016836609' }).then((res) => {
        // console.log(JSON.parse(res.data.type));
        let url = window.URL.createObjectURL(new Blob([res.data], { type: 'application/vnd.ms-excel' }))
        let link = document.createElement("a")
        link.style.display = "none"
        link.href = url
        link.setAttribute("download", 'a.xls')
        document.body.appendChild(link)
        link.click()
        document.body.removeChild(link)
        console.log(link);
      })
    },
    beforelod() {

    },
    //点击删除按钮
    handleRemove(file, fileList, row, flag) {
      console.log(file, fileList, row)
      if (flag === 1) {
        row.fileNameList = row.fileNameList.filter(item => {
          return item.fileId !== file.fileId;
        })
      } else if (flag === 2) {
        row.axioyNameList = row.axioyNameList.filter(item => {
          return item.fileId !== file.fileId;
        })
      }
    },
    //预览文件
    handlePreview(file) {
      console.log(file);
      upload_file({ fileId: file.fileId }).then((res) => {
        console.log(res);
        let url = window.URL.createObjectURL(new Blob([res.data], { type: 'application/pdf' }))

        window.open(url)
      })

    },
    //超出限制
    handleExceed() {
      this.$message.warning('每一项只能上传3个文件');
    },
    //点击移除的对话框
    beforeRemove(file) {
      return this.$confirm(`确定移除 ${file.name}?`);
    },
    //上传成功的回调
    handleSuccess(response, file, fileList, row, name, type) {
      if (response && response.state == '20000') {
        console.log(response, file, fileList, row, name, type);
        if (type == '资料上传') {
          name = name + '_资料上传'
          console.log(row);
          row.fileNameList.push({
            fileId: response.data,
            ...file,
          })
        
        } else if (type == '辅助证明文件上传') {
          name = name + '_辅助证明文件上传'
          row.axioyNameList.push({
            fileId: response.data,
            ...file,
          })
        }
        console.log(this.huixian);
      }
    },
    detailList() {
      zhubiao_detail({ reviewId: this.status.reviewId, type: this.status.type, level: this.level }).then((res) => {
        if (res.data.state == '20000') {
          var dataLIst = res.data.data;
          dataLIst.forEach(item => {
            this.chexiao.push(item.id)

            item.dataName = item.dataName.split('_').shift()
            item.fileNameList = []
            item.axioyNameList = []
            if (item.uploadDataFileId.length > 0) {
              item.uploadDataFileId = item.uploadDataFileId.split(',')
              item.uploadDataFileId.forEach((items) => {
                getFileName({ fileId: items }).then((res1) => {
                  let obj = {
                    fileId: items,
                    fileName: res1.data.data,
                    name: res1.data.data,
                  }

                  item.fileNameList.push(JSON.parse(JSON.stringify(obj)))

                })

              })
            } else {
              item.uploadDataFileId = []
            }
            if (item.uploadAuxiliaryFileId.length > 0) {
              item.uploadAuxiliaryFileId = item.uploadAuxiliaryFileId.split(',')
              item.uploadAuxiliaryFileId.forEach(items => {
                getFileName({ fileId: items }).then(res2 => {
                  let obj = {
                    fileId: items,
                    fileName: res2.data.data,
                    name: res2.data.data,
                  }
                  item.axioyNameList.push(JSON.parse(JSON.stringify(obj)))
                })
              })
            } else {
              item.uploadAuxiliaryFileId = []
            }
          })

          this.huixian = dataLIst
          this.table.fixedPlace = this.huixian[0].fixedPlace
          this.table.professionalTeam = this.huixian[0].professionalTeam
          this.table.registerLogin = this.huixian[0].registerLogin
          this.table.serveClientsDirection = this.huixian[0].serveClientsDirection
          this.table.staffingSituation = this.huixian[0].staffingSituation
          console.log(this.huixian);
        }

      })
    }
  },
  filters: {
    flitt(name) {
      console.log(name);
      var name1 = name.split(',')
      var name2 = name1.shift()
      console.log(name2);
      return name1.toString()
    }
  },
  mounted() {
    console.log(this.propA);
    this.token = localStorage.getItem('token')
    this.uploadData.userId = this.$store.state.userId
    this.tableData = this.$store.state.shenbaoData.tableData
    this.tableData2 = this.$store.state.shenbaoData.tableData2
    moban_list({ applicationType: 0 }).then((res) => {
      console.log(res);
    })

    pingtai_Count({ userId: this.$store.state.userId, type: '0' }).then((res) => {
      if(res.data.data&&res.data.data.pprovalStatus){
        this.isshenbao = res.data.data.pprovalStatus
      }
    })
  },
  watch: {
    propA: {
      handler: function (val, oldVal) {
        this.status = val
        this.reviewId = this.status.reviewId
        this.type = this.status.type
        this.level = this.status.level
        this.zhuangtai = this.status.status
        this.detailList()
      },
      // 深度观察监听
      immediate: true,
      deep: true,
    },
  },
  components: {
  }
}
</script>

<style scoped lang="scss">
::v-deep .el-upload-list__item.is-success.focusing .el-icon-close-tip {
  display: none !important;
}

.tooltip {
  display: block;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis
}

.title2 {
  width: 100%;
  height: 40px;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #1285D7;
  line-height: 40px;
  margin: 20px 0px;
  display: flex;

  div:nth-of-type(2) {
    color: black;
    font-size: 16px;
    margin: 0px 20px;
  }

  div:nth-of-type(3) {
    color: black;
    font-size: 15px;
  }
}

.tableBox {
  margin-bottom: 20px;

}

.declareBox {
  width: 1220px;
  height: 100%;
  background: #FFFFFF;
  margin: 30px auto;
  box-sizing: border-box;
  padding: 10px 50px;

  .title {
    display: flex;

    div:nth-of-type(1) {
      width: 120px;
      height: 50px;
      font-size: 18px;
      font-family: Microsoft YaHei;
      font-weight: bold;
      color: #262626;
      line-height: 50px;
      margin-bottom: 20px;
      border-bottom: 4px #1285D7 solid;

    }

    div:nth-of-type(2) {
      height: 50px;
      font-size: 15px;
      font-family: Arial;
      font-weight: 400;
      color: #DCDCDC;
      line-height: 50px;
      margin-right: 5px;

      border-bottom: 4px #1285D7 solid;

    }

    div:nth-of-type(3) {
      width: 189px;
      height: 50px;
      font-size: 15px;
      font-family: Arial;
      font-weight: 400;
      color: #DCDCDC;
      line-height: 50px;

      border-bottom: 4px #1285D7 solid;

    }

  }


}

.fujian {
  width: 1136px;
  height: 55px;
  background: #EBF5FC;
  font-size: 16px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #1285D7;
  line-height: 55px;
  margin: 10px 0px;
  padding-left: 20px;
  cursor: pointer;
}

.lianxi {
  display: flex;
  margin-bottom: 50px;

  div {
    width: 230px;
    height: 55px;
    background: #FAFAFA;
    border: 2px solid #EEEEEE;
    line-height: 55px;
    text-align: center;
  }

  div:nth-of-type(1) {
    width: 30%;
  }
}

.tableFoot {
  width: 100%;
  display: flex;
  justify-content: center;

  button {
    margin: 0px 10px;

    &:hover {
      cursor: pointer;
    }
  }

  button:nth-of-type(1) {
    width: 98px;
    height: 40px;
    background: #F39200;
    border: 0;
    border-radius: 3px 3px 3px 3px;
    color: white;
  }

  button:nth-of-type(2) {
    width: 98px;
    height: 40px;
    background: #2797E8;
    border-radius: 3px 3px 3px 3px;
    border: 0;

    color: white;
  }

  button:nth-of-type(3) {
    width: 98px;
    height: 40px;
    background: #FFFFFF;
    border-radius: 3px 3px 3px 3px;
    color: white;
    border: 0;
  }
}

.name {
  width: 208px;
  height: 45px;
  font-size: 16px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #FD8544;
}

.text {
  cursor: pointer;
  color: #1285D7;
}

.iconDownload {
  height: 14px;
  font-size: 14px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #1285D7;
}

.el-table__header {
  background-color: #1285D7 !important;
  color: white;
}

::v-deep .el-table__header th.is-leaf,
::v-deep .el-table__header th.gutter {
  background-color: #1285D7 !important;
  color: white;
  font-size: 16px;
}

.status {
  width: 48px;
  height: 16px;
  font-size: 16px;
  font-family: Microsoft YaHei;
  font-weight: bold;
  color: #D62502;
}

.yijian {
  color: #2797E8;
  cursor: pointer;
}

.el-button--primary {
  background-color: #fd8544;
  border-color: #fd8544;
}
</style>